import http from "@/utils/request"


//获取充值的产品


export const getVipProductApi = () => http.get("/product/get_product", {
    params: {
        category_id: '20210827165510715'
    }
})

//获取订单

export const getOrderApi = (order_id = "") => http.post('/order/get_order', {
    order_id
})


//查询订单的支付状态

export const getOrderStatusApi = order_id => http.get('/order/query_order_status', {
    params: {
        order_id
    }
})



//下单

export const preOrderApi = (product_id, quantity = 1) => http.post('/order/pre_order', {
    product_id,
    quantity
})

//发起支付

export const payMentApi = (order_id) => http.post('/pay/payment', {
    order_id
})

//获取产品详情

export const getProductApi = product_id => http.get('/product/get_product', {
    params: {
        product_id
    }
})

//查询支付状态

export const pollingPayStatusApi = order_id =>http.get('/order/query_order_status',{
    params:{
        order_id
    }
})